<?php
#Template for Choose model page. 
$page = (isset($page)) ? $page : 'cmodel';
include "inc/local_data.php";
$form = (isset($using_real_env) && $using_real_env) ? $form : ((isset($data[$page])) ? $data[$page] : array());
if (empty($form)) exit;


?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title><?php echo $form['title'];?></title>
		<?php include('inc/embed_top.php');?>
    </head>
    <body mlang="<?php echo $form['lang'];?>">
        <div id="cmodel" class="<?php echo $form['lang'];?>" data-role="page" data-theme="f">
            <div class="ltit"><span class="logo">&nbsp;</span><span class="r">tvb.com</span></div>
            <h1><?php echo $form['cmodel_title'];?></h1>
            <div class="ctit"><?php echo $form['card_payment'];?></div>
                <ul class="list1" data-role="listview" data-theme="f">
                    <li>
                        <a href="<?php echo $form['asia_pay_tvb']['link'];?>" rel="external"><?php echo $form['asia_pay_tvb']['name'];?><span><?php echo $form['asia_pay_tvb']['desc'];?></span></a>
                    </li>
                </ul>
                <div class="ctit"><?php echo $form['third_payment'];?></div>
                <ul class="list2" data-role="listview" data-theme="f">
                <?php
                
                foreach((array)$form['payment_gateway_list'] as $lit) {
                    $class_name        = $lit['name'].'logo';
                    $model_name        = $lit['name'];//strtoupper($lit['name']);
                    $model_rank        = $lit['rank'];
                    $model_prefix      = $lit['prefix'];
                    $model_title       = $lit['title'];
                    if (isset($using_real_env) && $using_real_env) {
                        //set base path for third-parties payment process.
                        $third_payment_urls  = NULL;
                        $login_id            = (!empty($form['lid'])) ? '&lid='.$form['lid'].'&call_back='.urlencode($form['m_call_back_url']) :  NULL;
                        $third_payment_urls  = $form['redirect_url'].'?pg='.$model_name.$login_id.'&call_back='.urlencode($form['m_call_back_url']).'&lang='.$form['lang'];
                    }
                    else {
                        $third_payment_urls = '#';
                    }
                ?>
                    <li><a href="<?php echo $third_payment_urls;?>" rel="external"><?php echo $model_title;?></a></li>
                <?php
                }
                
                ?>
    		</ul>
		</div>
		<?php include('inc/embed_bottom.php');?>
    </body>
</html>
